//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//********************************************************* 

using System;
using System.Collections.ObjectModel;

namespace Microsoft.TridentWordAddIn.Common
{
    /// <summary>
    /// Custom Event Args for Open File dialog Shown
    /// </summary>
    public class OpenFileDialogShownEventArgs : EventArgs
    {
        /// <summary>
        /// Gets or sets the intial directory.
        /// </summary>
        /// <value>The intial directory.</value>
        public string DefaultDirectory
        {
            get;
            set;
        }
    }

    /// <summary>
    /// Custom Event Args for Open File dialog Closed
    /// </summary>
    public class OpenFileDialogClosedEventArgs : EventArgs
    {
        /// <summary>
        /// Gets or sets the intial directory.
        /// </summary>
        /// <value>The intial directory.</value>
        public string CurrentDirectory
        {
            get;
            set;
        }
    }

    /// <summary>
    /// Event arguments for change of dock position
    /// </summary>
    public class DockPositionChangedEventArgs : EventArgs
    {
        private readonly TaskPaneDockPositions dockPosition;
        private readonly string taskPaneTitle;

        /// <summary>
        /// Initializes a new instance of the <see cref="DockPositionChangedEventArgs"/> class.
        /// </summary>
        /// <param name="dockPosition">The dock position.</param>
        /// <param name="taskPaneName">Name of the task pane.</param>
        public DockPositionChangedEventArgs(TaskPaneDockPositions dockPosition, string taskPaneName)
        {
            this.dockPosition = dockPosition;
            this.taskPaneTitle = taskPaneName;
        }

        /// <summary>
        /// Gets a value indicating the dock position of the originating task pane.
        /// </summary>
        /// <value>The dock position.</value>
        public TaskPaneDockPositions DockPosition
        {
            get { return this.dockPosition; }
        }

        /// <summary>
        /// Gets the title of the originating task pane.
        /// </summary>
        /// <value>The title of the task pane.</value>
        public string TaskPaneTitle
        {
            get { return this.taskPaneTitle; }
        }
    }

    /// <summary>
    /// Custom Cancel Close Event Args for Word Document
    /// </summary>
    public class CancelCloseEventArgs : EventArgs
    {
        private bool cancel;

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="CancelCloseEventArgs"/> is cancel.
        /// </summary>
        /// <value><c>true</c> if cancel; otherwise, <c>false</c>.</value>
        public bool Cancel
        {
            get { return this.cancel; }
            set { this.cancel = value; }
        }
    }

    /// <summary>
    /// Custom Document Save Event Args for Word Document
    /// </summary>
    public class DocumentSaveEventArgs : EventArgs
    {
        private bool cancelSaveDialog;

        /// <summary>
        /// Gets or sets a value indicating whether [cancel save dialog].
        /// </summary>
        /// <value><c>true</c> if [cancel save dialog]; otherwise, <c>false</c>.</value>
        public bool CancelSaveDialog
        {
            get { return this.cancelSaveDialog; }
            set { this.cancelSaveDialog = value; }
        }
    }

    public class BaseEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseEventArgs"/> class.
        /// </summary>
        /// <param name="documentKey">The document key.</param>
        public BaseEventArgs(int documentKey)
        {
            this.DocumentKey = documentKey;
        }

        /// <summary>
        /// Gets or sets the document key.
        /// </summary>
        /// <value>The document key.</value>
        public int DocumentKey { get; private set; }
    }

    /// <summary>
    /// Event arguments for change of visibility
    /// </summary>
    public class VisibilityChangedEventArgs : EventArgs
    {
        private readonly bool isVisible;
        private readonly string taskPaneTitle;

        /// <summary>
        /// Initializes a new instance of the <see cref="VisibilityChangedEventArgs"/> class.
        /// </summary>
        /// <param name="isVisible">if set to <c>true</c> the task pane is visible.</param>
        /// <param name="taskPaneName">Name of the task pane.</param>
        public VisibilityChangedEventArgs(bool isVisible, string taskPaneName)
        {
            this.isVisible = isVisible;
            this.taskPaneTitle = taskPaneName;
        }

        /// <summary>
        /// Gets a value indicating whether the originating task pane is visible.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this task pane is visible; otherwise, <c>false</c>.
        /// </value>        
        public bool IsVisible
        {
            get { return this.isVisible; }
        }

        /// <summary>
        /// Gets the title of the originating task pane.
        /// </summary>
        /// <value>The title of the task pane.</value>
        public string TaskPaneTitle
        {
            get { return this.taskPaneTitle; }
        }
    }

    public class SelectedJobChangedEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SelectedJobChangedEventArgs"/> class.
        /// </summary>
        /// <param name="job">The job.</param>
        /// <param name="workflow">The workflow.</param>
        public SelectedJobChangedEventArgs(WorkflowJob job, Workflow workflow)
        {
            this.Job = job;
            this.Workflow = workflow;
        }

        /// <summary>
        /// Gets or sets the job.
        /// </summary>
        /// <value>The job.</value>
        public WorkflowJob Job { get; set; }

        /// <summary>
        /// Gets or sets the workflow.
        /// </summary>
        /// <value>The workflow.</value>
        public Workflow Workflow { get; set; }
    }

    public class JobsUpdatedEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SelectedJobChangedEventArgs"/> class.
        /// </summary>
        public JobsUpdatedEventArgs()
        {
        }

        /// <summary>
        /// Gets or sets the count.
        /// </summary>
        /// <value>The count.</value>
        public int Count { get; set; }
    }

    public class SelectedActivityChangedEventArgs : EventArgs
    {
        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="SelectedActivityChangedEventArgs"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        public SelectedActivityChangedEventArgs(string name)
        {
            this.Name = name;
        }
    }

    public class ConnectionValidateEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionValidateEventArgs"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="isValid">if set to <c>true</c> [is valid].</param>
        /// <param name="controlType">Type of the control.</param>
        public ConnectionValidateEventArgs(string message, bool isValid, string controlType)
        {
            this.Message = message;
            this.IsValid = isValid;
            this.ControlType = controlType;
        }

        /// <summary>
        /// Gets or sets the error message.
        /// </summary>
        /// <value>The message.</value>
        public string Message { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is valid.
        /// </summary>
        /// <value><c>true</c> if this instance is valid; otherwise, <c>false</c>.</value>
        public bool IsValid { get; set; }

        /// <summary>
        /// Gets or sets the type of the control.
        /// </summary>
        /// <value>The type of the control.</value>
        public string ControlType { get; set; }
    }

    public class DatabaseClickedEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="OnDatabaseClickedEventArgs"/> class.
        /// </summary>
        public DatabaseClickedEventArgs()
        {
        }

        /// <summary>
        /// Gets or sets the database list.
        /// </summary>
        /// <value>The database list.</value>
        public string[] DatabaseList { get; set; }
    }

    public class ConnectionChangedEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionChangedEventArgs"/> class.
        /// </summary>
        /// <param name="documentKey">The document key.</param>
        /// <param name="connection">The connection.</param>
        public ConnectionChangedEventArgs(int documentKey, TridentConnection connection)
        {
            this.DocumentKey = documentKey;
            this.Connection = connection;
        }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is current connection.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is current connection; otherwise, <c>false</c>.
        /// </value>
        public bool IsCurrentConnection { get; set; }

        /// <summary>
        /// Gets or sets the operation.
        /// </summary>
        /// <value>The operation.</value>
        public ConnectionOperation Operation { get; set; }

        /// <summary>
        /// Gets or sets the document key.
        /// </summary>
        /// <value>The document key.</value>
        public int DocumentKey { get; set; }

        /// <summary>
        /// Gets or sets the connection.
        /// </summary>
        /// <value>The connection.</value>
        public TridentConnection Connection { get; set; }
    }

    public class PictureSelectionChangedEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionChangedEventArgs"/> class.
        /// </summary>
        /// <param name="documentKey">The document key.</param>
        /// <param name="documentPicture">The document picture.</param>
        public PictureSelectionChangedEventArgs(int documentKey, DocumentPicture documentPicture)
        {
            this.DocumentKey = documentKey;
            this.Picture = documentPicture;
        }

        /// <summary>
        /// Gets or sets the document key.
        /// </summary>
        /// <value>The document key.</value>
        public int DocumentKey { get; set; }

        /// <summary>
        /// Gets or sets the picture.
        /// </summary>
        /// <value>The picture.</value>
        public DocumentPicture Picture { get; set; }
    }

    public class AssociationChangedEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionChangedEventArgs"/> class.
        /// </summary>
        /// <param name="documentKey">The document key.</param>
        /// <param name="associationList">The association list.</param>
        public AssociationChangedEventArgs(int documentKey, DocumentPicture picture, ReadOnlyCollection<WorkflowAssociation> associationList)
        {
            this.DocumentKey = documentKey;
            this.Picture = picture;
            this.Associations = associationList;
        }

        /// <summary>
        /// Gets the document key.
        /// </summary>
        /// <value>The document key.</value>
        public int DocumentKey { get; private set; }

        /// <summary>
        /// Gets or sets the picture.
        /// </summary>
        /// <value>The picture.</value>
        public DocumentPicture Picture { get; private set; }

        /// <summary>
        /// Gets the associations.
        /// </summary>
        /// <value>The associations.</value>
        public ReadOnlyCollection<WorkflowAssociation> Associations { get; private set; }
    }

    public class RerunCompletedEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionChangedEventArgs"/> class.
        /// </summary>
        /// <param name="documentKey">The document key.</param>
        /// <param name="association">The association.</param>
        public RerunCompletedEventArgs(int documentKey, WorkflowAssociation association)
        {
            this.DocumentKey = documentKey;
            this.Association = association;
        }

        /// <summary>
        /// Gets the document key.
        /// </summary>
        /// <value>The document key.</value>
        public int DocumentKey { get; private set; }

        /// <summary>
        /// Gets the association.
        /// </summary>
        /// <value>The association.</value>
        public WorkflowAssociation Association { get; private set; }
    }

    public class ProgressEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ConnectionChangedEventArgs"/> class.
        /// </summary>
        /// <param name="documentKey">The document key.</param>
        /// <param name="message">The message.</param>
        public ProgressEventArgs(int documentKey, string message)
        {
            this.DocumentKey = documentKey;
            this.StatusMessage = message;
        }

        /// <summary>
        /// Gets the document key.
        /// </summary>
        /// <value>The document key.</value>
        public int DocumentKey { get; private set; }

        /// <summary>
        /// Gets the status message.
        /// </summary>
        /// <value>The status message.</value>
        public string StatusMessage { get; private set; }
    }

    public class SelectedAssociationEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SelectedAssociationEventArgs"/> class.
        /// </summary>
        /// <param name="documentKey">The document key.</param>
        /// <param name="association">The association.</param>
        public SelectedAssociationEventArgs(int documentKey, WorkflowAssociation association)
        {
            this.DocumentKey = documentKey;
            this.Association = association;
        }

        /// <summary>
        /// Gets the document key.
        /// </summary>
        /// <value>The document key.</value>
        public int DocumentKey { get; private set; }

        /// <summary>
        /// Gets or sets the association.
        /// </summary>
        /// <value>The association.</value>
        public WorkflowAssociation Association { get; private set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public class IsValidEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="IsValidEventArgs"/> class.
        /// </summary>
        /// <param name="result">The result.</param>
        public IsValidEventArgs()
        {
            
        }

        /// <summary>
        /// 
        /// </summary>
        public string result;
    }
}
